-
Notifications
You must be signed in to change notification settings - Fork 25
Add interrupt feature #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Memory usage change @ 95cbcc6
Click for full report table
Click for full report CSV
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can fix the spell check failure by adding the problematic word in all lower case (als
) here;
https://github.com/arduino-libraries/Arduino_APDS9960/blob/master/.codespellrc#L4
Co-authored-by: per1234 <accounts@perglass.com>
Memory usage change @ bb0a9b4
Click for full report table
Click for full report CSV
|
@@ -52,7 +52,7 @@ bool APDS9960::begin() { | |||
if (!setWTIME(0xFF)) return false; | |||
if (!setGPULSE(0x8F)) return false; // 16us, 16 pulses // default is: 0x40 = 8us, 1 pulse | |||
if (!setPPULSE(0x8F)) return false; // 16us, 16 pulses // default is: 0x40 = 8us, 1 pulse | |||
if (!setGestureIntEnable(true)) return false; | |||
//if (!setGestureIntEnable(true)) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not fine, if useless remove the cmment otherwise add and fix incompatibility
/*clearLightInterrupt(); | ||
clearProximityInterrupt();*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -428,15 +433,99 @@ int APDS9960::readProximity() { | |||
return -1; | |||
} | |||
|
|||
disableProximity(); | |||
//disableProximity(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
#if defined(APDS9960_INT_PIN) | ||
APDS9960 APDS(APDS9960_WIRE_INSTANCE, APDS9960_INT_PIN); | ||
#elif defined(ARDUINO_ARDUINO_NANO33BLE) | ||
APDS9960 APDS(Wire1, PIN_INT_APDS); | ||
#else | ||
APDS9960 APDS(Wire, -1); | ||
#endif | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add new line here
data &= 0b01111111; //MSB reserved | ||
data |= 0b1; //PowerON | ||
data |= 0b00010000; //ALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no number create macros and give a meanings to each action
void APDS9960::enableProximityInterrupt(){ | ||
uint8_t data; | ||
getENABLE(&data); | ||
data &= 0b01111111; //MSB reserved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no number create macros and give a meanings to each action
data &= 0b01111111; //MSB reserved | ||
data |= 0b1; //PowerON | ||
data &= 0b01011111; //Int prox disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no number create macros and give a meanings to each action
@@ -150,4 +168,4 @@ class APDS9960 { | |||
|
|||
extern APDS9960 APDS; | |||
|
|||
#endif // ARDUINO_APDS9960 | |||
#endif // ARDUINO_APDS9960 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add new line here
All the changes I requested have been made. Thanks!
I've added the minimun configuration to enable the interrupt pin